/***
Wave
创建人：ZЁЯ¤　身高：168cm+；体重：57kg+；未婚（已有女友）；最爱的运动：睡觉；格言：路见不平，拔腿就跑。QQ：358315553。
创建时间：2012年12月05日 00:29:24
简要说明：这家伙很懒什么都没写。
用法举例：这家伙还是很懒什么都没写。
*/

package zero.shaders.test{
	import flash.display.*;
	import flash.geom.*;
	import flash.utils.*;
	import zero.shaders.*;
	
	/**
	 * 
	 * 波浪
	 * 
	 */	
	public class Wave extends BaseShader{
		
		public static const nameV:Vector.<String>=new <String>["alpha","center1","A1","w1","q1","center2","A2","w2","q2"];
		//WaveCode//为了编译进来
		public static const byteV:Vector.<int>=new <int>[0xa5,0x01,0x00,0x00,0x00,0xa4,0x04,0x00,0x57,0x61,0x76,0x65,0xa0,0x0c,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x00,0x7a,0x65,0x72,0x6f,0x2e,0x73,0x68,0x61,0x64,0x65,0x72,0x73,0x2e,0x74,0x65,0x73,0x74,0x00,0xa0,0x0c,0x76,0x65,0x6e,0x64,0x6f,0x72,0x00,0x5a,0xa7,0xa7,0xa7,0xc1,0xa1,0xe8,0x00,0xa0,0x08,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x00,0x02,0x00,0xa0,0x0c,0x64,0x65,0x73,0x63,0x72,0x69,0x70,0x74,0x69,0x6f,0x6e,0x00,0xb2,0xa8,0xc0,0xcb,0x00,0xa1,0x01,0x02,0x00,0x00,0x0c,0x5f,0x4f,0x75,0x74,0x43,0x6f,0x6f,0x72,0x64,0x00,0xa1,0x01,0x01,0x00,0x00,0x02,0x61,0x6c,0x70,0x68,0x61,0x00,0xa1,0x01,0x02,0x01,0x00,0x0c,0x63,0x65,0x6e,0x74,0x65,0x72,0x31,0x00,0xa1,0x01,0x01,0x00,0x00,0x01,0x41,0x31,0x00,0xa1,0x01,0x01,0x01,0x00,0x02,0x77,0x31,0x00,0xa1,0x01,0x01,0x01,0x00,0x01,0x71,0x31,0x00,0xa1,0x01,0x02,0x02,0x00,0x0c,0x63,0x65,0x6e,0x74,0x65,0x72,0x32,0x00,0xa1,0x01,0x01,0x02,0x00,0x02,0x41,0x32,0x00,0xa1,0x01,0x01,0x02,0x00,0x01,0x77,0x32,0x00,0xa1,0x01,0x01,0x03,0x00,0x08,0x71,0x32,0x00,0xa3,0x00,0x04,0x73,0x72,0x63,0x00,0xa1,0x02,0x04,0x04,0x00,0x0f,0x64,0x73,0x74,0x00,0x32,0x03,0x00,0x40,0x00,0x00,0x00,0x00,0x2a,0x03,0x00,0x40,0x00,0x00,0x80,0x00,0x1d,0x01,0x80,0x80,0x00,0x80,0x00,0x00,0x34,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x1d,0x03,0x00,0x61,0x00,0x00,0x10,0x00,0x32,0x03,0x00,0x10,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x10,0x03,0x00,0xc0,0x00,0x1d,0x01,0x80,0x40,0x00,0x80,0x00,0x00,0x34,0x00,0x00,0x00,0x01,0x80,0x40,0x00,0x32,0x03,0x00,0x10,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1d,0x05,0x00,0xc1,0x01,0x00,0x10,0x00,0x25,0x05,0x00,0xc1,0x03,0x00,0x60,0x00,0x1d,0x05,0x00,0x40,0x01,0x00,0x80,0x00,0x03,0x05,0x00,0x40,0x05,0x00,0x00,0x00,0x1d,0x05,0x00,0x80,0x05,0x00,0x40,0x00,0x02,0x05,0x00,0x80,0x01,0x00,0xc0,0x00,0x0c,0x05,0x00,0x40,0x05,0x00,0x00,0x00,0x1d,0x05,0x00,0x80,0x00,0x00,0xc0,0x00,0x03,0x05,0x00,0x80,0x05,0x00,0x40,0x00,0x1d,0x03,0x00,0x10,0x05,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x28,0x02,0x00,0x20,0x05,0x00,0x00,0x00,0x1d,0x01,0x80,0x40,0x00,0x80,0x00,0x00,0x34,0x00,0x00,0x00,0x01,0x80,0x40,0x00,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1d,0x05,0x00,0xc1,0x02,0x00,0x10,0x00,0x25,0x05,0x00,0xc1,0x03,0x00,0x60,0x00,0x1d,0x05,0x00,0x40,0x02,0x00,0xc0,0x00,0x03,0x05,0x00,0x40,0x05,0x00,0x00,0x00,0x1d,0x05,0x00,0x80,0x05,0x00,0x40,0x00,0x02,0x05,0x00,0x80,0x03,0x00,0x00,0x00,0x0c,0x05,0x00,0x40,0x05,0x00,0x00,0x00,0x1d,0x05,0x00,0x80,0x02,0x00,0x80,0x00,0x03,0x05,0x00,0x80,0x05,0x00,0x40,0x00,0x01,0x03,0x00,0x10,0x05,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1d,0x05,0x00,0xc1,0x03,0x00,0x60,0x00,0x01,0x05,0x00,0xc1,0x03,0x00,0xf0,0x00,0x30,0x06,0x00,0xf1,0x05,0x00,0x10,0x00,0x1d,0x04,0x00,0xf3,0x06,0x00,0x1b,0x00,0x03,0x04,0x00,0x10,0x00,0x00,0x80,0x00,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x32,0x04,0x00,0x40,0x00,0x00,0x00,0x00,0x32,0x04,0x00,0x20,0x00,0x00,0x00,0x00,0x32,0x04,0x00,0x10,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00];
		
		/**
		 * 
		 * 透明度 （0~1） 默认 1
		 * 
		 */
		public var alpha:Number;
		
		/**
		 * 
		 * 振源中心1 默认 null
		 * 
		 */
		public var center1:Float2;
		
		/**
		 * 
		 * 振幅1 （0~100） 默认 10
		 * 
		 */
		public var A1:Number;
		
		/**
		 * 
		 * 角速度1 （0~1） 默认 0.3
		 * 
		 */
		public var w1:Number;
		
		/**
		 * 
		 * 初相1 （0~100） 默认 0
		 * 
		 */
		public var q1:Number;
		
		/**
		 * 
		 * 振源中心2 默认 null
		 * 
		 */
		public var center2:Float2;
		
		/**
		 * 
		 * 振幅2 （0~100） 默认 10
		 * 
		 */
		public var A2:Number;
		
		/**
		 * 
		 * 角速度2 （0~1） 默认 0.3
		 * 
		 */
		public var w2:Number;
		
		/**
		 * 
		 * 初相2 （0~100） 默认 0
		 * 
		 */
		public var q2:Number;
		

		/**
		 * 
		 * 透明度 （0~1） 默认 1<br/>
		 * 振源中心1 默认 null<br/>
		 * 振幅1 （0~100） 默认 10<br/>
		 * 角速度1 （0~1） 默认 0.3<br/>
		 * 初相1 （0~100） 默认 0<br/>
		 * 振源中心2 默认 null<br/>
		 * 振幅2 （0~100） 默认 10<br/>
		 * 角速度2 （0~1） 默认 0.3<br/>
		 * 初相2 （0~100） 默认 0<br/>
		 * 
		 */
		public function Wave(_alpha:Number=1,_center1:Float2=null,_A1:Number=10,_w1:Number=0.3,_q1:Number=0,_center2:Float2=null,_A2:Number=10,_w2:Number=0.3,_q2:Number=0){
			alpha=_alpha;
			(data.alpha as ShaderParameter).value=[];
			center1=_center1;
			(data.center1 as ShaderParameter).value=[];
			A1=_A1;
			(data.A1 as ShaderParameter).value=[];
			w1=_w1;
			(data.w1 as ShaderParameter).value=[];
			q1=_q1;
			(data.q1 as ShaderParameter).value=[];
			center2=_center2;
			(data.center2 as ShaderParameter).value=[];
			A2=_A2;
			(data.A2 as ShaderParameter).value=[];
			w2=_w2;
			(data.w2 as ShaderParameter).value=[];
			q2=_q2;
			(data.q2 as ShaderParameter).value=[];
		}
		
		override public function updateParams():void{
			(data.alpha as ShaderParameter).value[0]=alpha;
			(data.center1 as ShaderParameter).value[0]=center1.x;
			(data.center1 as ShaderParameter).value[1]=center1.y;
			(data.A1 as ShaderParameter).value[0]=A1;
			(data.w1 as ShaderParameter).value[0]=w1;
			(data.q1 as ShaderParameter).value[0]=q1;
			(data.center2 as ShaderParameter).value[0]=center2.x;
			(data.center2 as ShaderParameter).value[1]=center2.y;
			(data.A2 as ShaderParameter).value[0]=A2;
			(data.w2 as ShaderParameter).value[0]=w2;
			(data.q2 as ShaderParameter).value[0]=q2;
		}
		

	}
}